package cn.ml.io.liu;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

public class FISTest {
    public static void main(String[] args) {
        FileInputStream fis = null;
        try {
            fis = new FileInputStream(new File("D:\\1_JAVA\\java_long\\basis\\src\\cn\\ml\\chuji\\io\\liu\\test.txt"));
            System.out.println("test.txt文件的大小为："+fis.available());

            int date;
            while((date=fis.read())!=-1){
                System.out.print(date+"__");
                System.out.print((char) date);
            }

            /*byte[] b = new byte[100];
            int date;
            while ((date = fis.read(b))!=-1){
                System.out.println(date);
                for(int i=0;i<date;i++){
                    System.out.print((char) b[i]);
                }
            }*/

        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            try {
                fis.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

    }
}
